import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '项目id',
    align: "center",
    dataIndex: 'projectId'
  },
  {
    title: '系统id',
    align: "center",
    dataIndex: 'systemId'
  },
  {
    title: '父模块ID',
    align: "center",
    dataIndex: 'parentId'
  },
  {
    title: '模块名',
    align: "center",
    dataIndex: 'moduleName'
  },
  {
    title: '英文名',
    align: "center",
    dataIndex: 'moduleNameEn'
  },
  {
    title: '缩写',
    align: "center",
    dataIndex: 'moduleNameAbbr'
  },
  {
    title: '排序',
    align: "center",
    dataIndex: 'departOrder'
  },
  {
    title: '描述',
    align: "center",
    dataIndex: 'description'
  },
  {
    title: '机构类别 1公司，2组织机构，3岗位',
    align: "center",
    dataIndex: 'orgCategory'
  },
  {
    title: '备注',
    align: "center",
    dataIndex: 'comments'
  },
  {
    title: '状态',
    align: "center",
    dataIndex: 'status'
  },
  {
    title: '叶子节点',
    align: "center",
    dataIndex: 'isLeaf'
  },
  {
    title: '删除状态',
    align: "center",
    dataIndex: 'delFlag'
  },
  {
    title: '租户ID',
    align: "center",
    dataIndex: 'tenantId'
  },
  {
    title: '是否有叶子节点: 1是0否',
    align: "center",
    dataIndex: 'izLeaf'
  },
];

//查询数据
export const searchFormSchema: FormSchema[] = [
];

//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '项目id',
    field: 'projectId',
    component: 'Input',
  },
  {
    label: '系统id',
    field: 'systemId',
    component: 'Input',
  },
  {
    label: '父模块ID',
    field: 'parentId',
    component: 'Input',
  },
  {
    label: '模块名',
    field: 'moduleName',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入模块名!'},
             ];
    },
  },
  {
    label: '英文名',
    field: 'moduleNameEn',
    component: 'Input',
  },
  {
    label: '缩写',
    field: 'moduleNameAbbr',
    component: 'Input',
  },
  {
    label: '排序',
    field: 'departOrder',
    component: 'InputNumber',
  },
  {
    label: '描述',
    field: 'description',
    component: 'Input',
  },
  {
    label: '机构类别 1公司，2组织机构，3岗位',
    field: 'orgCategory',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
      return [
              { required: true, message: '请输入机构类别 1公司，2组织机构，3岗位!'},
             ];
    },
  },
  {
    label: '备注',
    field: 'comments',
    component: 'Input',
  },
  {
    label: '状态',
    field: 'status',
    component: 'Input',
  },
  {
    label: '叶子节点',
    field: 'isLeaf',
    component: 'Input',
  },
  {
    label: '删除状态',
    field: 'delFlag',
    component: 'Input',
  },
  {
    label: '租户ID',
    field: 'tenantId',
    component: 'InputNumber',
  },
  {
    label: '是否有叶子节点: 1是0否',
    field: 'izLeaf',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
  {
    label: '',
    field: 'id',
    component: 'Input',
    show: false,
  },
];
